package pluginmgr

import (
	"github.com/hashicorp/go-hclog"
	"io"
	"log"
)

// pluginLogger 实现 go-plugin 的 Logger 接口
type pluginLogger struct{}

func (l *pluginLogger) Trace(msg string, args ...interface{}) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Debug(msg string, args ...interface{}) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Info(msg string, args ...interface{}) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Warn(msg string, args ...interface{}) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Error(msg string, args ...interface{}) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) IsTrace() bool {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) IsDebug() bool {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) IsInfo() bool {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) IsWarn() bool {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) IsError() bool {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) ImpliedArgs() []interface{} {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) With(args ...interface{}) hclog.Logger {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Name() string {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Named(name string) hclog.Logger {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) ResetNamed(name string) hclog.Logger {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) SetLevel(level hclog.Level) {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) GetLevel() hclog.Level {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer {
	//TODO implement me
	panic("implement me")
}

func (l *pluginLogger) Log(level hclog.Level, msg string, args ...interface{}) {
	switch level {
	case hclog.Trace:
		log.Printf("[TRACE] "+msg, args...)
	case hclog.Debug:
		log.Printf("[DEBUG] "+msg, args...)
	case hclog.Info:
		log.Printf("[INFO] "+msg, args...)
	case hclog.Warn:
		log.Printf("[WARN] "+msg, args...)
	case hclog.Error:
		log.Printf("[ERROR] "+msg, args...)
	default:
		log.Printf("[UNKNOWN] "+msg, args...)
	}
}
